package com.bdqn.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.Table;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

@Data
@Table(name = "sys_right")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer","handler"})
public class Right implements Serializable {
  @Serial
  private static final long serialVersionUID = 1L;

  @TableId(type = IdType.AUTO)
  @TableField("right_code")
  private String rightCode;

  @TableField("right_parent_code")
  private String rightParentCode;

  @TableField("right_type")
  private String rightType;

  @TableField("right_text")
  private String rightText;

  @TableField("right_url")
  private String rightUrl;

  @TableField("right_tip")
  private String rightTip;

  @ManyToMany(targetEntity = Role.class,mappedBy = "rights")
  @JsonIgnore
  private Set<Role> roles=new HashSet<Role>(0);
}
